package sy.action;

import java.util.List;

import org.apache.struts2.convention.annotation.Action;
import org.springframework.beans.factory.annotation.Autowired;

import sy.pageModel.Menu;
import sy.service.MenuServiceI;

import com.opensymphony.xwork2.ModelDriven;

@Action("menuAction")
public class MenuAction extends BaseAction implements ModelDriven<Menu>{

	@Autowired
	private MenuServiceI menuServiceI;
	private Menu menu = new Menu();
 	@Override
	public Menu getModel() {
		// TODO Auto-generated method stub
		return menu;
	}

 	public void tree(){
 		super.writeJson(menuServiceI.getTree(menu.getId()));
 	}
 	public void getAllTree(){
 		super.writeJson(menuServiceI.getAllTree());
 	}
}
